-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partially remove db exist check if ignore db is false #17300
Partially remove db exist check if ignore db is false #17300
Conversation
6fe9b50
to
e95e8ca
Compare
The |
Test Results 20 files 20 suites 1h 17m 47s ⏱️ Results for commit 2991646. ♻️ This comment has been updated with latest results. |
The |
5 similar comments
The |
The |
The |
The |
The |
@@ -22,7 +22,6 @@ init_config: | |||
# - query: <QUERY> | |||
# columns: <COLUMNS> | |||
# tags: <TAGS> | |||
# collection_interval: <COLLECTION_INTERVAL> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the checks failed and asked me to run some script that aligns this file with config. We could also split in 2 PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try rebase with master and run ddev validate config sqlserver -s
except ConfigurationError: | ||
if self._config.ignore_missing_database: | ||
# self.connection.check_database() will try to connect to 'master'. | ||
# If this is a DB hosted on Azure the function would throw. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DB hosted on Azure
is too vague. Let's be specific that the issue is for Azure SQL Database.
with self.connection.open_managed_default_connection(): | ||
with self.connection.get_managed_cursor() as cursor: | ||
try: | ||
self.log.debug("Calling Stored Procedure : %s", proc) | ||
if self.connection.connector == 'adodbapi': | ||
cursor.callproc(proc) | ||
else: | ||
# pyodbc does not support callproc; use execute instead. | ||
# Reference: https://github.com/mkleehammer/pyodbc/wiki/Calling-Stored-Procedures | ||
call_proc = '{{CALL {}}}'.format(proc) | ||
cursor.execute(call_proc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change required for this PR? if it's a cleanup, let's open another PR to minimize the changes
The |
1 similar comment
The |
da08d7d
to
2991646
Compare
@@ -22,7 +22,6 @@ init_config: | |||
# - query: <QUERY> | |||
# columns: <COLUMNS> | |||
# tags: <TAGS> | |||
# collection_interval: <COLLECTION_INTERVAL> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try rebase with master and run ddev validate config sqlserver -s
What does this PR do?
Removes the database exist check in sql_integration if ignore_missing_database is set to false
Motivation
The database exist check got introduced in #357 for the reason that we don't see as valid anymore. The check is error prone and causes false positive. Nevertheless in order to avoid a breaking change we dont modify the behaviour for users that set ignore_missing_database to true. For user who set it to False we remove the check as anyway the exception when connecting to database will be thrown.
Review checklist (to be filled by reviewers)
qa/skip-qa
label if the PR doesn't need to be tested during QA.